<?php defined('SYSPATH') or die('No direct script access.');

class Mythumb_Core extends Thumbalizr {
  function __construct() {
    parent::__construct();
  }

  function InputInDir($url){
    $data = Kohana::config('thumbalizr.MyThumbs');
    $ret = $this->getimage($url);
    if($ret == TRUE){
      $file = $this->local_cache_subdir."/".$this->local_cache_file;
      $filec = DOCROOT.$data['directory']."/".$this->local_cache_file;
      copy($file,$filec);
      $this->FileInfo = array(
        'namefile' => $this->local_cache_file,
        'filepath' => $filec,
        'fileurl' => $data['directory']."/".$this->local_cache_file,
        'htmlimg' => html::image($data['directory']."/".$this->local_cache_file),
      );
      return TRUE;
    }else{
    $this->FileInfo = $this->headers;
    return FALSE;
    }
  }
}
  